[BLTAP] Use getpagesize() for portability.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 20 Dec 2006 10:11:45 +0000 (10:11 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 20 Dec 2006 10:11:45 +0000 (10:11 +0000)
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
tools/blktap/drivers/block-qcow.c

index 882ac06cd676e3452a5ac349c35a3ab701172912..ff8e9a0a4a41c4b436f32fd28c6536d5c9faac0b 100644 (file)
@@ -1352,8 +1352,9 @@ int qcow_create(const char *filename, uint64_t total_size,
        printf("Created cksum: %d\n",exthdr.cksum);
        free(ptr);
 
-       /*adjust file length to 4 KByte boundary*/
-       length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),PAGE_SIZE);
+       /*adjust file length to system page size boundary*/
+       length = ROUNDUP(header_size + (l1_size * sizeof(uint64_t)),
+               getpagesize());
        if (qtruncate(fd, length, 0)!=0) {
                DPRINTF("ERROR truncating file\n");
                return -1;